
class Money implements Cloneable{
    public static double money = 19.9;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Person implements Cloneable{
    public int age;
    public Money m;


    public Person(int age){
        this.age = age;
        this.m =new Money();
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", m=" + m +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp = (Person)super.clone();
        tmp.m = (Money)this.m.clone();
        return tmp;
    }
}

public class J2410291 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person = new Person(24);
        Person person2 =(Person)person.clone();
        Money money = new Money();
        System.out.println(person);
        System.out.println(person2);
        System.out.println(Money.money);
        person2.m.money = 99.9;
        System.out.println(person.m.money);
        System.out.println(person2.m.money);
        System.out.println(Money.money);
    }
}
